Skip to content

sendpay: self payments: succeed retries - #9517

Open
Lagrang3 wants to merge 1 commit into
ElementsProject:masterfrom
Lagrang3:fix/sendpay-replay-selfpayment
Open

Lagrang3 wants to merge 1 commit into
ElementsProject:masterfrom
Lagrang3:fix/sendpay-replay-selfpayment

Conversation

@Lagrang3

Copy link
Copy Markdown
Collaborator

According to the documentation of sendpay:

Calls to sendpay with the same payment_hash,
amount_msat, and destination as a previous
successful payment (even if a different route
or partid) will return immediately with success.

A self payment is a special case, but the destination being always ourselves should follow the same rule.

Changelog-Fixed: sendpay: inmediately success when replaying a completed self payment.

According to the documentation of sendpay:

    Calls to sendpay with the same payment_hash,
    amount_msat, and destination as a previous
    successful payment (even if a different route
    or partid) will return immediately with success.

A self payment is a special case, but the destination being
always ourselves should follow the same rule.

Changelog-Fixed: sendpay: immediate success when replaying a completed self payment.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
@Lagrang3
Lagrang3 force-pushed the fix/sendpay-replay-selfpayment branch from 0a411a6 to 6dc8523 Compare September 16, 2026 07:44

@Andezion Andezion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not caused by this pr, but noticed while reviewing, that self_payment() never calls check_invoice_request_usage()? (unlike send_payment_core at pay.c at line 1111), so bolt12 invoice-request usage isnt tracked/enforced for self-payments even on the non-replay path?

@madelinevibes madelinevibes added this to the v26.09 milestone Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants